<?php

require_once('utils/template.php');
require_once('utils/db.php');
require_once('locations.php');

//////////////////////////////////////
// Business/Data Layer
//////////////////////////////////////

//TODO Get the right client id
$id_client = 1;

$sql = "select f_titre, loc_deb, loc_fin, loc_montant 
        from locations, films
        where loc_cli = $id_client
        and loc_film = f_id
        order by loc_deb";

$rq = execQuery($sql);
$res = $rq->fetchAll();

//////////////////////////////////////////
// View Layer
//////////////////////////////////////////
$main = new Template('views/facture.view.php', array(
    'title' => 'Facture',
    'res' => $res,
));
$main->render();

?>
